package com.qf.service.impl;

import com.qf.entity.Product;
import com.qf.entity.ProductDTO;
import com.qf.mapper.ProductMapper;
import com.qf.service.ProductService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.Collections;
import java.util.List;

/**
 * --- 万物归集  不随你我 ---
 * <p>
 * 快捷短语
 * main ==  public static void main(String[] args);
 * sout ==  System.out.println();
 *
 * @author shuhan
 * @date 2025/4/27
 * @desc 商品服务实现类
 */
@Service
public class ProductServiceImpl implements ProductService {
    @Autowired
    private ProductMapper productMapper;

    @Override
    public List<Product> findAll(ProductDTO productDTO) {
        return productMapper.findAll(productDTO);
    }

    @Override
    public Boolean deleteById(int id) {
        return productMapper.deleteById(id);
    }

    @Override
    public Boolean addProduct(Product product) {
        return productMapper.addProduct(product);
    }

    @Override
    public Boolean updateProduct(Product product) {
        return productMapper.updateProduct(product);
    }

    @Override
    public void insertList(List<Product> cachedDataList) {
        productMapper.insertList(cachedDataList);
    }
}
